<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
	<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="../../common/base.jsp"%>
<%
	response.setCharacterEncoding("utf-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Insert title here</title>
<link href="${path }/dist/css/bootstrap.css" rel="stylesheet">

<!-- Button -->
<link href="${path }/dist/css/compiled/elements.css" rel="stylesheet">
<!-- libraries -->
<link rel="stylesheet" type="text/css"  href="${path }/dist/css/font-awesome.css">
<!-- this -->
<link rel="stylesheet" type="text/css" href="${path }/dist/css/app.css">
<link href='${path }/dist/css/zTreeStyle/zTreeStyle.css' rel='stylesheet' />
<link href="${path }/dist/css/bootstrap-datetimepicker.min.css" rel="stylesheet"><%--时间日期工具 --%>
<!-- 右键菜单插件 -->
<link rel="stylesheet" type="text/css" href="${path }/dist/css/smartMenu.css">

<script src="${path }/dist/js/jquery.min.js"></script>
<script src='${path }/dist/js/bootstrap.min.js'></script>
<script src="${path }/dist/js/theme.js"></script>

<style>

.table tr>td select{
	width: 100%;
}
html{
	height: 300px;
}
bady{
	height: 300px;
}
.menuContent {padding-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:160px;height:260px;overflow-y:scroll;overflow-x:auto;}
thead th{
	min-width: 70px;
}
tbody td{
	white-space: nowrap; overflow: hidden;text-overflow: ellipsis;
}
</style>
</head>
<body>
	<form action="${path }/back/assetsMS!search_ifrom" id="list_page_form">
	<div style="width: 1000px;">
	<table id="assetstable" class="table-striped table-bordered" style="table-layout: fixed;">
		<thead>
			<tr>
				<th>资产编号</th>
				<th>资产分类</th>
				<th>资产名称</th>
				<th>资产规格</th>
				<th>资产价值</th>
				<th>购置日期</th>
				<th>资产数量</th>
				<th >备注</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="l" items="${assetsList}">
				<tr data-number="${l['a_number'] }" data-id="${l['id'] }">
					<td data-name='assets_number'>${l['a_number'] }</td>
					<td data-name='assets_class_name'>${l['a_class_name'] }</td>
					<td data-name='assets_name'>${l['a_name'] }</td>
					<td data-name='assets_specification'>${l['a_specification'] }</td>
					<td data-name='assets_money'><fmt:formatNumber type="number" value="${l['a_unit_price'] }" pattern="#.00"/></td>
					<td >${l['a_buy_date'] }</td>
					<td data-name='assets_num'>1</td>
					<td >${l['a_remark'] }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>
	<input type="hidden" name="select_number" value="${select_number }">
	<input type="hidden" name="not_number" value="${not_number }">
	<div class="row">
			<div class="col-md-12">
				<%@include file="../page.jsp" %>
			</div>
		</div>
		
	</form>

	<script type="text/javascript">

		
	$(document).ready(function() {
		$("#assetstable tbody>tr").click(function(){
			if(window.parent!=null)
				window.parent.remove_add_row_input($(this));
		});
		
	});
	function add_row_input(){
		if($("#node_tbody").find('#add_row').size()==0){
			var tr_obj=$("<tr></tr>").appendTo($("#node_tbody"));
			$("<td></td>").appendTo(tr_obj);
			var td_obj=$("<td></td>").appendTo(tr_obj);
			var input_obj=$("<input type='text' id='add_row' class='form-control input-sm'/>").appendTo(td_obj);
			$("#add_row").bind("focus",{id:"#assetsMenu"},getassets);
		}
	}

	function fromisnotnull(fromdom){
		var  pass =true;
		$("input[type='text'][data-vail]",fromdom).each(function(){
			if($(this).val()==null||$(this).val()==""){
				alert("红色为必填项");
				pass =false;
				return false;
			}
		});
		return pass;
	}
	function onBodyDown(evetnt){
		if(!($(evetnt.target).closest(evetnt.data.id).length>0)){
			hidetree(evetnt.data.id);
		}
	}
	//解除 body绑定
	function hidetree(id){
		$(id+"").fadeOut("fast");
		$("body").unbind("mousedown",onBodyDown);
	}
	</script>
</body>
</html>
<%--	alert(1);

		    var c = $(window.parent.document.body) 
		    //麻烦的方法：
		    //var c = $($(window).eq(0)[0].parent.document).find('body'); //，忘了可以用前面的方法了
		    c.bind('beforeunload', function(e) {    
		        // Mozilla takes the
		        alert(1);
		    }); --%>